<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    function qc(arr) {
        //先排序，相同的数字就会在一起
        var newArr = arr.sort(function(a, b) {
            return a - b //升序
        })
        console.log(newArr)
            //遍历数组，找到到一样的
        for (var j = 0; j < newArr.length; j++) {
            if (newArr[j] == newArr[j + 1]) {
                newArr.splice(j, 1)
                j--
            }
        }
        console.log(newArr)
    }
    qc([1, 3, 3, 4, 5, 6, 8, 2, 4, 5, 6, 3, 4, 3, 4, 11])
</script>